package com.iven.xie.demo.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyException {

    @ExceptionHandler(value = Exception.class)
    public String myException(Exception e) {
        String msg = "======>错误信息：" + e.getMessage();
        System.out.println(msg);
        return msg;
    }

}
